<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>我的信息</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/common.css}" rel="stylesheet">
    <link th:href="@{/css/user.css}" rel="stylesheet">
    <!-- springboot访问三个点的静态文件有时候会出现一些访问404的问题。 -->
    <link th:href="@{/css/datetimepicker.css}" rel="stylesheet" type="text/css"/>

</head>
<body>
<div class="container" style="background:white">
    <div th:replace="~{commons/common::header}"></div>
    <div th:replace="~{commons/common::topbar}"></div>
    <div class="row">
        <div class="col-md-9 col-sm-12">
            <div class="user-info-box">
                <div class="user-info-inner-box">
                    <h2 style="margin-bottom:25px">个人信息</h2>
                    <form class="form-horizontal" id="InfoForm" method="post" th:action="@{/user/modifyInfo}"
                          enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">头像</label>
                            <div class="col-sm-8">
                                <img id="imgEmdImg" class="img-circle"
                                     th:src="@{/{src}(src=(${UserInfo.userImage}==''?'imgs/default.jpg':'upload/'+${UserInfo.userImage}))}">
                                <input type="file" name="userImageSrc" id="userImageSrc" accept="image/*"
                                       th:value="${UserInfo.userImage}==null?'111.jpg':${UserInfo.userImage}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">用户名</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control reg-input" th:value="${UserInfo.userLoginname}"
                                       disabled >
                                <input type="hidden" id="userLoginname" name="userLoginname"
                                       class="form-control reg-input" th:value="${UserInfo.userLoginname}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><font color="red">* </font>昵称</label>
                            <div class="col-sm-8">
                                <input type="text" id="userNickname" name="userNickname" class="form-control reg-input"
                                       th:value="${UserInfo.userNickname}" autocomplete="off">
                                <font color="red"></font>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">性别</label>
                            <div class="col-sm-8">
                                <input type="hidden" name="userSexValue" id="userSexValue"
                                       th:value="${UserInfo.userSex}" autocomplete="off">
                                <select name="userSex" id="userSex" class="form-control reg-select">
                                    <option th:selected="${UserInfo.userSex == 0}"
                                            th:value="0" disabled>请选择
                                    </option>
                                    <option th:selected="${UserInfo.userSex == 1}" th:value="1">男
                                    </option>
                                    <option th:selected="${UserInfo.userSex == 2}" th:value="2">女
                                    </option>
                                </select>
                                <font color="red"></font>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">省份</label>
                            <div class="col-sm-8">
                                <select name="userProvince" id="userProvince" class="form-control reg-select">
                                    <option th:selected="${cities.isEmpty()}" value="0" disabled>请选择省会</option>
                                    <option th:each="p:${provinces}" th:value="${p.id}" th:text="${p.name}"
                                            th:selected="${p.id==UserInfo.userProvince}"></option>
                                </select>
                                <font color="red"></font>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">城市</label>
                            <div class="col-sm-8">
                                <select name="userCity" id="userCity" class="form-control reg-select">
                                    <option th:selected="${cities.isEmpty()}" value="0" disabled>请选择城市</option>
                                    <option th:if="${not cities.isEmpty()}" th:each="c:${cities}" th:value="${c.id}"
                                            th:text="${c.name}" th:selected="${c.id==UserInfo.userCity}"></option>
                                </select>
                                <font color="red"></font>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">生日</label>
                            <div class="col-sm-8">
                                <input type="text" id="datetimepicker" name="userBirthday"
                                       class="form-control reg-input" autocomplete="off"
                                       th:value="${UserInfo.userBirthday}==null? '2021-01-01':${UserInfo.userBirthday}">
                                <font color="red"></font>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">个性签名</label>
                            <div class="col-sm-8">
                                <input type="text" id="userSignature" name="userSignature"
                                       class="form-control reg-input" autocomplete="off"
                                       th:value="${UserInfo.userSignature}==null? '':${UserInfo.userSignature}">
                                <font color="red"></font>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-2">
                                <button type="button" id="userInfo-Modify-btn" class="btn btn-primary btn-lg btn-block">
                                    提交
                                </button>
                            </div>
                            <div class=" col-sm-2">
                                <button type="button" id="backButton" class="btn btn-default btn-lg btn-block">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-md-3 col-sm-12">
            <div th:replace="~{commons/common::headerimage}"></div>
            <div th:replace="~{commons/common::hotrange}"></div>
        </div>
    </div>
    <div th:replace="~{commons/common::footer}"></div>
</div>

</body>

<script th:src="@{/js/jquery-1.11.0.min.js}"></script>
<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/common.js}"></script>
<script th:src="@{/js/button.js}"></script>
<script th:src="@{/js/datetimepicker/jquery.datetimepicker.full.min.js}"></script>
<script th:src="@{/js/user/userInfo.js}"></script>
</html>







